/**
 * @author LKQ
 * @date 2021/12/22 21:39
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        solution.hammingWeight(0b00000000000000000000000000001011);
    }

    public int hammingWeight(int n) {
        int ans = 0;
        while( n!= 0) {
            if((n & 1) == 1) {
                ans++;
            }
            n >>>= 1;
        }
        return ans;
    }
}
